<?php


namespace app\common\service;

use think\response\Json;

class ApiResponseService
{
    protected $response;

    public function __construct(Json $response)
    {
        $this->response = $response;
    }

    /**
     * 成功输出数据
     * @param $list
     * @return Json
     */
    public function success($list): Json
    {
        $this->response->data(['status'=>1,'msg'=>'success','list'=>$list]);

        return $this->response;
    }

    public function send($msg,$status=1)
    {
        $this->response->data(['status'=>$status,'msg'=>$msg]);

        return $this->response;
    }
}
